//
//  Account.m
//  iWeibo
//
//  Created by dengwei on 15/7/31.
//  Copyright (c) 2015年 dengwei. All rights reserved.
//

#import "Account.h"

@implementation Account

#pragma mark 归档的时候调用
-(void)encodeWithCoder:(NSCoder *)encoder
{

    [encoder encodeObject:_oid forKey:@"oid"];

    [encoder encodeObject:_uid forKey:@"uid"];

    [encoder encodeObject:_username forKey:@"username"];
    
    [encoder encodeObject:_authCode forKey:@"authCode"];

    [encoder encodeObject:_petName forKey:@"petName"];

    [encoder encodeObject:_rolecode forKey:@"rolecode"];

    [encoder encodeObject:_avatar forKey:@"avatar"];
    
    [encoder encodeObject:_password forKey:@"password"];

    [encoder encodeObject:_websiteName forKey:@"websiteName"];

    [encoder encodeObject:_picture forKey:@"picture"];
    
    [encoder encodeObject:@(_isReinforce) forKey:@"isReinforce"];

}

-(id)initWithCoder:(NSCoder *)decoder
{
    if (self = [super init]) {

        self.oid = [decoder decodeObjectForKey:@"oid"];

        self.uid = [decoder decodeObjectForKey:@"uid"];

        self.username = [decoder decodeObjectForKey:@"username"];

        self.authCode = [decoder decodeObjectForKey:@"authCode"];

        self.petName = [decoder decodeObjectForKey:@"petName"];

        self.rolecode = [decoder decodeObjectForKey:@"rolecode"];

        self.avatar = [decoder decodeObjectForKey:@"avatar"];

        self.password = [decoder decodeObjectForKey:@"password"];

        self.websiteName = [decoder decodeObjectForKey:@"websiteName"];

        self.picture = [decoder decodeObjectForKey:@"picture"];
        
        self.isReinforce = [[decoder decodeObjectForKey:@"isReinforce"] boolValue];

    }

    return self;
}


//- (NSString*)description {
//    
//    return [NSString stringWithFormat:@"accessToken = %@, iconUrl = %@,gender = %@,nickName = %@",self.accessToken, self.iconUrl,self.gender,self.nickName];
//    
//}
@end
